﻿using System;
using System.Data;
using System.Collections.Generic;

using RexToy.ORM;

namespace Studio.Model
{
    class OracleModel : DatabaseModel
    {
        public OracleModel()
        {
            _server = "XE";
            _username = "Test";
            _password = "test";
        }

        public override string ConnectString
        {
            get { return string.Format("User ID={0};Data Source={1};Password={2}", _username, _server, _password); }
        }

        public override string Dialect
        {
            get { return RexToy.ORM.Oracle.OracleDialect.ORACLE; }
        }

        public override string Provider
        {
            get { return "RexToy.ORM.DbAccess.Oracle.DbProvider,RexToy.ORM.Oracle"; }
        }

        public override string DialectProvider
        {
            get { return "RexToy.ORM.Dialect.Oracle.DialectProvider,RexToy.ORM.Oracle"; }
        }

        public override void ReadModel()
        {
            using (var db = DatabaseFactory.OpenDatabase())
            {
                _tables = db.QueryMeta().Tables;
            }
        }
    }
}
